package com.huarui.purchaseOrder.service.provider.taskOwner;

import java.util.ArrayList;
import java.util.List;

import com.huarui.purchaseOrder.model.PurOrSaleOrder;
import com.huarui.task.model.TaskOwner;
import com.huarui.task.service.provider.TaskOwnerProvider;
import com.huarui.task.service.provider.UpdateTaskOwnerHandler;

public class PurOrSaleTakeOverToUpdateTaskOwnerProviderImpl implements TaskOwnerProvider, UpdateTaskOwnerHandler{

	private TaskOwner b_taskOwner;
	private TaskOwner s_taskOwner;
	
	private PurOrSaleOrder orders;
	
	
	public PurOrSaleTakeOverToUpdateTaskOwnerProviderImpl(TaskOwner b_taskOwner, 
			TaskOwner s_taskOwner, PurOrSaleOrder orders) {
		super();
		this.b_taskOwner = b_taskOwner;
		this.s_taskOwner = s_taskOwner;
		this.orders = orders;
	}
	
	@Override
	public Object updateTaskOwner() {
		TaskOwner t1 = PurOrSaleTaskOwnerUtil.updateRemark(b_taskOwner, orders);
		TaskOwner t2 = PurOrSaleTaskOwnerUtil.updateRemark(s_taskOwner, orders);
		List<TaskOwner> list = new ArrayList<TaskOwner>();
		list.add(t1); list.add(t2);
		return list;
	}

}
